import request from '@/utils/request'

// 查询报废记录列表
export function listScrap(query) {
  return request({
    url: '/equ/scrap/list',
    method: 'get',
    params: query
  })
}
// 查询报废记录列表
export function listScrapVo(query) {
  return request({
    url: '/equ/scrap/listVo',
    method: 'get',
    params: query
  })
}
// 查询报废记录详细
export function getScrap(scrapId) {
  return request({
    url: '/equ/scrap/' + scrapId,
    method: 'get'
  })
}

// 新增报废记录
export function addScrap(data) {
  return request({
    url: '/equ/scrap',
    method: 'post',
    data: data
  })
}

// 修改报废记录
export function updateScrap(data) {
  return request({
    url: '/equ/scrap',
    method: 'put',
    data: data
  })
}

// 删除报废记录
export function delScrap(scrapId) {
  return request({
    url: '/equ/scrap/' + scrapId,
    method: 'delete'
  })
}

 // 获取报废记录列表
export function listScraps(assetId) {
  return request({
    url: '/equ/scrap/getScrapByAssetId/' + assetId,
    method: 'get'
  })
}
